UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lVdKkFLBD6zNjH2ZdNk+7XJ9GOm4i4Zh3lXxgDRirUw='
WHERE
key_id = '980cbd6e55537b8eb3d65438056a1a1203d6050d46ee49d3b291848baac112d2'
AND (
token = 'lVdKkFLBD6zNjH2ZdNk+7XJ9GOm4i4Zh3lXxgDRirUw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)