UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8Q767omKZQoE8VTLmyi+5KD+AWKt01QHmdP3KhAinCo=' 
WHERE 
  key_id = 'ee1e02b079d497e95319ffea85640e49d571bc209a9c574f45d13ce1c3ff7588' 
  AND (
    token = '8Q767omKZQoE8VTLmyi+5KD+AWKt01QHmdP3KhAinCo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031