UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/VsX8FpA6mB5FaAHhR4Yqzs9Dkyclzo1PSLuqqsJvTE=' 
WHERE 
  key_id = '0fc17ec4f468409a91e972b738f08d21713ee91355f30943ea4b9494dab36960' 
  AND (
    token = '/VsX8FpA6mB5FaAHhR4Yqzs9Dkyclzo1PSLuqqsJvTE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040