UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EoLBwuv8I+tvoVLjr3AuPYvQ853UXtYMX82XUCtXIDY='
WHERE
key_id = 'f751b6154f7ffb84aa2f84290852d8e5c6619c5966578dc15d91f728a80eb722'
AND (
token = 'EoLBwuv8I+tvoVLjr3AuPYvQ853UXtYMX82XUCtXIDY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)