UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yeMJLPBIWvkSbFEWkHLN+/8+9R3enjtGImdelmV8nr8='
WHERE
key_id = '570f23f55b653eea6138b4d86a7761b1011e4b5c7b10217a678054c953c1c335'
AND (
token = 'yeMJLPBIWvkSbFEWkHLN+/8+9R3enjtGImdelmV8nr8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)