UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ohhqp5NmxxuVYlYOqb255dBS/YAhEKebtpPqETg+Pv8='
WHERE
key_id = 'db9d5254eacc63ccb783ecb520c6ad708c292fcffbf5278a4036ef9df01e83f2'
AND (
token = 'ohhqp5NmxxuVYlYOqb255dBS/YAhEKebtpPqETg+Pv8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)