UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5nzDTXwk+mXH3KXWg+qN35a2sA2cQ1CNftx2rkB2fL0='
WHERE
key_id = '883fd42b49b28137988bfb4e1de33283257b880632399d42ca1c14051a1507ff'
AND (
token = '5nzDTXwk+mXH3KXWg+qN35a2sA2cQ1CNftx2rkB2fL0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)