UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9Upay4tOrGmu7pJEbYADlIj+ScDIIqdIIBQYa9Vya2o='
WHERE
key_id = '85afa40d98efb009da22655b688aaa2edd148ff996edf622d6315a9ef35cc9a1'
AND (
token = '9Upay4tOrGmu7pJEbYADlIj+ScDIIqdIIBQYa9Vya2o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)