UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'aZFc/+5fnB88KiaCn+jGzYH8wNsxvo3dLZ3oqsjuZAQ='
WHERE
key_id = '4cd5b67ee6f5b8e51a6e815ac4d3439706af1b4080662cb9d9664051547b22d4'
AND (
token = 'aZFc/+5fnB88KiaCn+jGzYH8wNsxvo3dLZ3oqsjuZAQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)