UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IPurNF1E39gqtklpQ6jmSvlaE0Fwi+kxeOE1aau/wDU='
WHERE
key_id = '062c23cf842e1373536d5218ec12249166ebf980879207a6ba8ed0d1d0311b32'
AND (
token = 'IPurNF1E39gqtklpQ6jmSvlaE0Fwi+kxeOE1aau/wDU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)