UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'L7Fjld0c4X3O3f+obKhHwLJMs44Jbi676eUa0McRnhs='
WHERE
key_id = '3c00470cb275bc9d729b5219271f8df940cdc22ea27e3d1da984b1aa24117c37'
AND (
token = 'L7Fjld0c4X3O3f+obKhHwLJMs44Jbi676eUa0McRnhs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)