UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XvAUnaJjJ/aOlc+LEc21NasVCfBzz/Y+hBv1Bp/bbC8='
WHERE
key_id = 'e5c6eccbc57090170682d2c0c0abeba57c75e087ad21ad5bb6cba47a018a7444'
AND (
token = 'XvAUnaJjJ/aOlc+LEc21NasVCfBzz/Y+hBv1Bp/bbC8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)