UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SinKkdBTDKqAMfoEhUkKjFSTQ7lCwDbGz2VVZCvdFiQ='
WHERE
key_id = '4fa9abcc5e7ea31f6d01fe51e59a0701bafda492387efdeadee37869d20d1ef1'
AND (
token = 'SinKkdBTDKqAMfoEhUkKjFSTQ7lCwDbGz2VVZCvdFiQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)