UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PMrgqAe1L3BrATQl6B7i44xqTlhUybLEbxUF7kkZCzc=' 
WHERE 
  key_id = 'b8056e7933dd07929d3bffb5abb9e53a161d1f68e584fb69d973f2c0680cc1fe' 
  AND (
    token = 'PMrgqAe1L3BrATQl6B7i44xqTlhUybLEbxUF7kkZCzc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017