UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Q3im0Ldl+XKUtJTOKDJCUM9pWdJMEL40w9Ya13vIiY8='
WHERE
key_id = '6425a69f33237d6c09e9106b44f942afd3003070392a183082f0ce262ffc8cb8'
AND (
token = 'Q3im0Ldl+XKUtJTOKDJCUM9pWdJMEL40w9Ya13vIiY8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)