UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gMKPXLyVhZXPOIo2To/weaAUZtLvki467OQ8r5cBofU=' 
WHERE 
  key_id = '95eafe8276570d29389485c14e8ebf7a22c58aded48ab92d299f8c87b498800f' 
  AND (
    token = 'gMKPXLyVhZXPOIo2To/weaAUZtLvki467OQ8r5cBofU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033