UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zpRgvOT8hfv0IpVl7tKsqh1/fFaP66dcRyCQIM/E6H4='
WHERE
key_id = '0a851d6718d04f3841699fef00058fcc381ada0428d88aef28ef797d519cd420'
AND (
token = 'zpRgvOT8hfv0IpVl7tKsqh1/fFaP66dcRyCQIM/E6H4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)