UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kL3ZkVu0srEjOKcfPTeazAxeEYi1Z6t+GB5tiYmcN0M=' 
WHERE 
  key_id = '25ed8d1eaca8b7f80509a13f8e187926555710f64d6c14b46e6f1de0f300b343' 
  AND (
    token = 'kL3ZkVu0srEjOKcfPTeazAxeEYi1Z6t+GB5tiYmcN0M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00098