UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '51t5Ao3JUopH1sKB4rQO4+UU9xN8CtFEZqSgfapfZHg='
WHERE
key_id = '7ddbc70a390a2202945f18dd78ca44f79e166ba14f4e30414de82244d36c837e'
AND (
token = '51t5Ao3JUopH1sKB4rQO4+UU9xN8CtFEZqSgfapfZHg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)