UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gUHvhDRxl2JSkiBwc/NBWEydc37Se1Xx0S0EMg2LD4s='
WHERE
key_id = '4b646b704ef72f9ee3fe36dead3d531208cf30dbf052b90be04343bd3ee0f61b'
AND (
token = 'gUHvhDRxl2JSkiBwc/NBWEydc37Se1Xx0S0EMg2LD4s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)