UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'aMpi/YjWMJ1BT9eJIGDrAbFsT41b1k+FnGvK+COS6qQ=' 
WHERE 
  key_id = '0899f4820ea315fd8152e46212ef9624d916de00cd28d80f2a1f3b8f38d8ee98' 
  AND (
    token = 'aMpi/YjWMJ1BT9eJIGDrAbFsT41b1k+FnGvK+COS6qQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035