UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fJx654R4Rm0A2reqbk8CG7+YEyXorpcARIRCYldwIAQ='
WHERE
key_id = '0edf0fdfcd810f53740738fdaf4d08f67670462c8af6b2e40ad7e1bc964cfa7b'
AND (
token = 'fJx654R4Rm0A2reqbk8CG7+YEyXorpcARIRCYldwIAQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)