UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZmMYqzQ8YyeMBShgGJydyqQTK3FnKt/2SQBOgjf6nMc='
WHERE
key_id = 'd517d84e8c3f0dc8e03aa6b91ecf59a194240c12a743d2b2d171eae061174993'
AND (
token = 'ZmMYqzQ8YyeMBShgGJydyqQTK3FnKt/2SQBOgjf6nMc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)