UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eEdF2I1ZAvA6u9oIVN0ghq+j3qsNkKReKz4xrKIMdhg='
WHERE
key_id = 'b322e58f530b91b6f97e561157b731c74d9ab2d5c2cb8e3660c595290d77c7f9'
AND (
token = 'eEdF2I1ZAvA6u9oIVN0ghq+j3qsNkKReKz4xrKIMdhg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)