UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UdKJn6gP1AyPn2pjPalzO/YAt9iZ/C9X9D7T3mDngGA=' 
WHERE 
  key_id = 'f5cc29d08f36fd5c450f9fb96c3fd88aa860c49b0e93b31aca2236b80eb59068' 
  AND (
    token = 'UdKJn6gP1AyPn2pjPalzO/YAt9iZ/C9X9D7T3mDngGA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033