UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2WUwr4Miwuo6NZhtxaER6pV/cAuR7tonhVrk1smbuME='
WHERE
key_id = 'a8e74164a8213ea1055c3cc37beea8fbcaeb85a0e40fc52db808eee6e0b6e11b'
AND (
token = '2WUwr4Miwuo6NZhtxaER6pV/cAuR7tonhVrk1smbuME='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)