UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tR5VMOz1lCxS0laIxK19LBKEnSGyMQzIyWI4XIFBUJI=' 
WHERE 
  key_id = '64fe4963aed5708eb161c4ac197232aeaab6fe06fab9e59907a8a51fa28b6276' 
  AND (
    token = 'tR5VMOz1lCxS0laIxK19LBKEnSGyMQzIyWI4XIFBUJI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023