UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ar4iS27TGOrY1jyUnZLxuRoZddH6xPqb+MfKbWxLTIQ='
WHERE
key_id = '10682af2060b3e6d0109b815b4f7c67cefc1e65007e79c18c6266257828b48c0'
AND (
token = 'ar4iS27TGOrY1jyUnZLxuRoZddH6xPqb+MfKbWxLTIQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)