UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0StzcriLf//By73fIvZgaKAH2vJQyyJnC0DfIl3127s='
WHERE
key_id = '6eea494b021be75d4a420a63d713e608bf77b634210682f69c51eb6d078b0d06'
AND (
token = '0StzcriLf//By73fIvZgaKAH2vJQyyJnC0DfIl3127s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)