UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8KO1Ws8lwM8oPq5mib44CkRXQ3eFgcKZs+Fh6kMG6gk='
WHERE
key_id = '2d3d0c63e4649561f7c72a0396705779bc0ffdc263b77bbab984bcc6705ae688'
AND (
token = '8KO1Ws8lwM8oPq5mib44CkRXQ3eFgcKZs+Fh6kMG6gk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)