UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uJo3QIAJ+k2iDSoN5qSvSh8eCVZsU/DOmQTstjQqmi8='
WHERE
key_id = '14a988267bffcdc4f54f74751f63db831f032fdffcdcd71091cc173f6c1420b8'
AND (
token = 'uJo3QIAJ+k2iDSoN5qSvSh8eCVZsU/DOmQTstjQqmi8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)