UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3PpXw+/FyOvqGUqrk9burjXZ2xpYQBpoFltmB/551lI=' 
WHERE 
  key_id = 'f39e3bdae38cf05bfff0318b9505726f17cf10f98ff0799b7db5d671b629f0cd' 
  AND (
    token = '3PpXw+/FyOvqGUqrk9burjXZ2xpYQBpoFltmB/551lI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036