UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'E1x/MC2H7wgzyGZ5xlYmpK6yXR/JESiEMY37H2x1rp0='
WHERE
key_id = 'c3c7c17cdb43c9331fe5d698b1b1ba7ec21476ab6a992cdadc7fa91b0a537de9'
AND (
token = 'E1x/MC2H7wgzyGZ5xlYmpK6yXR/JESiEMY37H2x1rp0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)